import React from "react";
import Payload from "../views/payload";
import Success from "../views/success";

const Home = React.lazy(() => import("../views/home"));
const Detail = React.lazy(() => import("../views/detail"));
const Login = React.lazy(() => import("../views/login"));
const My = React.lazy(() => import("../views/my"));
const Order = React.lazy(() => import("../views/order"));
const Register = React.lazy(() => import("../views/register"));
const TripServer = React.lazy(() => import("../views/tripServer"));
const Vip = React.lazy(() => import("../views/vip"));
const MainLayout = React.lazy(() => import("../views/mainLayout"));
const City = React.lazy(() => import("../views/city"));
const List = React.lazy(() => import("../views/list"));
const ORCPersonSelect = React.lazy(() => import("../views/orcPersonSelect"));

export const routes = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    meta: {
      title: "布局组件",
    },
    children: [
      {
        path: "/",
        element: <Home></Home>,
        meta: {
          title: "首页",
        },
      },
      {
        path: "/trip/server",
        element: <TripServer></TripServer>,
        meta: {
          title: "出行服务",
        },
      },
      {
        path: "/order",
        element: <Order></Order>,
        meta: {
          title: "订单",
        },
      },
      {
        path: "/vip",
        element: <Vip></Vip>,
        meta: {
          title: "铁路会员",
        },
      },
      {
        path: "/my",
        element: <My></My>,
        meta: {
          title: "我的",
        },
      },
    ],
  },
  {
    path: "/login",
    element: <Login></Login>,
    meta: {
      title: "登录",
    },
  },
  {
    path: "/register",
    element: <Register></Register>,
    meta: {
      title: "注册",
    },
  },
  {
    path: "/detail/:id",
    element: <Detail></Detail>,
    meta: {
      title: "详情",
    },
  },
  {
    path: "/city",
    element: <City></City>,
    meta: {
      title: "城市选择",
    },
  },
  {
    path: "/list",
    element: <List></List>,
    meta: {
      title: "列表",
    },
  },
  {
    path: "/orc/person/select",
    element: <ORCPersonSelect></ORCPersonSelect>,
    meta: {
      title: "选择乘车人",
    },
  },
  {
    path: "/payload",
    element: <Payload></Payload>,
    meta: {
      title: "支付",
    },
  },
  {
    path: "/success",
    element: <Success></Success>,
    meta: {
      title: "支付成功",
    },
  },
];
